<%--
  Created by IntelliJ IDEA.
  User: www10
  Date: 2022/4/16
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>成功页面</title>
</head>
<body>
            <h3>WHAT FUCK</h3>
<h2>${test}</h2>
<h3>${user.name}</h3>
            <script src="${pageContext.request.contextPath}/resource/js/jquery-3.6.0/jquery-3.6.0.js"></script>
<div style="background-color: #00F7DE;width: 600px;height: 600px;margin: auto">
    <a onclick="f1()"> 测试一下</a>
    <br>
    <a onclick="f2()" class="test"> f2测试一下</a>
    <br>
    <a class="test2"> f3测试一下</a>
    <br>
    <a class="f4"> f4测试一下</a>


</div>
</body>
    <script type="text/javascript">
        window.onload=function () {
            f1()
        }
        function f1() {
            var t='${user.name}'
            console.log(t)
        }

        function f2() {
            var arrs={arr:"123"};
            var obj={
                "name":"齐浩",
                 "age":15
            }
            $.ajax({
                url:"/model/success3",
                data:obj,
                dataType:"json",
                contentType:"application/json",
                success:function (data) {
                    console.log(data)
                    console.log("进来了")
                }
            })
        }

        //jquery 单机方法
        $(".test2").click(function () {
            console.log($(".test2").text())
            })

        //jquery 单机方法
        $(".f4").click(function () {
            $(".f4").append("<h1>追加测试</h1>")
        })



        var common={

            init:function (){
                var self=this;
                self.testAttr();

                return self;
            },


            testAttr:function (){
                console.log("进来了")
                $("input[name='validity']").after(' <a data-id="123" href="#">i love china</a>');
                var test=$("a[data-id='123']").text();
                console.log(test)
            }
        }.init()
    </script>
</html>
